let api = `${baseApi}deviceManagement`;

/**					
 * @addByDevice 添加设备信息
 * @return axios
 */
export const addByDevice = function (params) {
    return axios.post(`${api}/addByDevice`, params);
}

/**					
 * @getAllByCondition 条件查询所有的设备信息（带分页）
 * @return axios
 */
export const getAllByCondition = function (params) {
    return axios.post(`${api}/getAllByCondition`, params);
}

/**					
 * @getAllByPage 查询所有的设备信息（带分页）
 * @return axios
 */
export const getAllByPage = function (params) {
    return axios.post(`${api}/getAllByPage`, params);
}

/**					
 * @getDeviceById 根据设备id查询设备信息
 * @return axios
 */
export const getDeviceById = function (params) {
    return axios.get(`${api}/getDeviceById/${params}`);
}

/**					
 * @updateByDevice 修改设备信息
 * @return axios
 */
export const updateByDevice = function (params) {
    return axios.put(`${api}/updateByDevice`,params);
}

/**					
 * @getThirdPartyUuid 在第三方数据库的uuid
 * @return axios
 */
export const getThirdPartyUuid = function (params) {
    return axios.get(`${api}/getThirdPartyUuid`,{params:params});
}

/**					
 * @getThirdPartyToken 存放第三方设备token信息
 * @return axios
 */
export const getThirdPartyToken = function (params) {
    return axios({
        method: 'post',
        url:`${api}/getThirdPartyToken`,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
        },
        data: params,
        params: params
    })
}


/**					
 * @getYunDingTokenUrl 获取云丁的token的路径信息
 * @return axios
 */
export const getYunDingTokenUrl = function () {
    return axios.get(`${api}/getYunDingTokenUrl`);
}

/**					
 * @getWeiYuTokenUrl 获取微羽的token的路径信息
 * @return axios
 */
export const getWeiYuTokenUrl = function () {
    return axios.get(`${api}/getWeiYuTokenUrl`);
}

/**					
 * @getLuMiTokenUrl 获取绿米的token的路径信息
 * @return axios
 */
export const getLuMiTokenUrl = function (params) {
    return axios.get(`${api}/getLuMiTokenUrl`,{params:params});
}